package com.rxh.service.impl.core;

import com.rxh.mapper.core.CoreOrderDetailMapper;
import com.rxh.pojo.Result;
import com.rxh.pojo.core.CoreOrderDetail;
import com.rxh.service.base.AbstractBaseService;
import com.rxh.service.core.CoreOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CoreOrderDetailServiceImpl extends AbstractBaseService<CoreOrderDetail, Long> implements CoreOrderDetailService {
    private final CoreOrderDetailMapper coreOrderDetailMapper;

    @Autowired
    public CoreOrderDetailServiceImpl(CoreOrderDetailMapper coreOrderDetailMapper) {
        this.coreOrderDetailMapper = coreOrderDetailMapper;
        setMapper(coreOrderDetailMapper);
    }

    @Override
    public Result<CoreOrderDetail> selectByOrderId(Long orderId) {
        return new Result<>(Result.SUCCESS, coreOrderDetailMapper.selectByOrderId(orderId));
    }
}